import 'package:flutter/material.dart';

/// My customized RefreshProgressIndicator. It returns the system [RefreshProgressIndicator] by default.
/// You can use any widget as you like.
class MyRefreshProgressIndicator extends StatelessWidget {
  const MyRefreshProgressIndicator({super.key});

  @override
  Widget build(BuildContext context) {
    return const RefreshProgressIndicator();
  }
}

/// My customized CircularProgressIndicator. It returns the system [CircularProgressIndicator] by default.
/// You can use any widget as you like.
class MyCircularProgressIndicator extends StatelessWidget {
  const MyCircularProgressIndicator({super.key});

  @override
  Widget build(BuildContext context) {
    return const CircularProgressIndicator();
  }
}

/// My customized CircularProgressIndicator. It returns the system [LinearProgressIndicator] by default.
/// You can use any widget as you like.
class MyLinearProgressIndicator extends StatelessWidget {
  const MyLinearProgressIndicator({super.key, this.value, this.height = 2.0});

  final double? value;
  final double height;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: height,
      child: LinearProgressIndicator(value: value),
    );
  }
}

/// Displays [MyCircularProgressIndicator] on the top-center.
class MyPageTopCenterLoadingIndicator extends StatelessWidget {
  const MyPageTopCenterLoadingIndicator(
      {super.key, this.padding = const EdgeInsets.only(top: 23.0)});

  final EdgeInsetsGeometry padding;

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: padding,
      child: const Align(
        alignment: Alignment.topCenter,
        child: MyCircularProgressIndicator(),
      ),
    );
  }
}

/// Displays [MyCircularProgressIndicator] on the center.
class MyPageCenterLoadingIndicator extends StatelessWidget {
  const MyPageCenterLoadingIndicator({super.key});

  @override
  Widget build(BuildContext context) {
    return const Center(
      child: MyCircularProgressIndicator(),
    );
  }
}
